//
//  DefectDetailViewController.m
//  Audit
//
//  Created by cc on 15-2-15.
//  Copyright (c) 2015年 cc. All rights reserved.
//

#import "DefectDetailViewController.h"
#import "SJAvatarBrowser.h"

@interface DefectDetailViewController ()
{
    IBOutlet UIImageView *_imageView;

    IBOutlet UILabel *componentTitleOne;//部件名称1
    IBOutlet UILabel *componentTitleTwo;//部件名称2
    IBOutlet UILabel *defectInfo;//缺陷
    IBOutlet UILabel *position;//位置
    IBOutlet UILabel *weight;//权重
    IBOutlet UILabel *area;//区域
    IBOutlet UILabel *redepartment;//责任部门
    IBOutlet UISwitch *repair;//返修
    IBOutlet UISwitch *perception;//感知
}
@end

@implementation DefectDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self setNavTitle:@"缺陷详情"];
    [self setNavBackButton:nil];
    [self setNavRightButton:@"关闭"];
    
    _imageView.image = self.selectedDefect.uploadedFile;
    componentTitleOne.text=self.selectedDefect.partDesc;
    componentTitleTwo.text=self.selectedDefect.part2Desc;
    defectInfo.text=self.selectedDefect.defectDesc;
    position.text=self.selectedDefect.locationDesc;
    weight.text=self.selectedDefect.weightDesc;
    area.text=self.selectedDefect.zoneDesc;
    redepartment.text=self.selectedDefect.respareaDesc;
    [repair setOn:[self.selectedDefect.repairFlag isEqualToString:@"1"]?YES:NO];
    [perception setOn:[self.selectedDefect.senseFlag isEqualToString:@"1"]?YES:NO];
    
    repair.enabled=NO;
    perception.enabled=NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)navRightButtonActionAtTag:(NSUInteger)tag
{
    //todo:返回数据
    [super backAction:nil];
}

-(IBAction)imageButtonAction:(id)sender
{
    [SJAvatarBrowser showImage:_imageView];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
